package com.caltco.cargo.ops.modules.sys.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.caltco.cargo.ops.common.base.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;

@Data
@TableName("achievements")
@Schema(description = "用户实体类")
public class Achievements extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.ASSIGN_ID)
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(description = "Id")
    private Long id;

    @Schema(description = "成就名称")
    private String name;

    @Schema(description = "成就描述")
    private String description;

    @Schema(description = "成就icon url")
    @TableField("icon_url")
    @JsonProperty("iconUrl")
    private String iconUrl;

    @Schema(description = "达成条件类型")
    @TableField("requirement_type")
    @JsonProperty("requirementType")
    private String requirementType;

    @Schema(description = "达成条件数值")
    @TableField("requirement_value")
    @JsonProperty("requirementValue")
    private Integer requirementValue;

    @Schema(description = "是否删除")
    @TableField("is_delete")
    @JsonProperty("isDelete")
    @TableLogic(value = "0", delval = "1")
    private Integer isDelete;
}
